/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package client;

import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.Spatial;
import com.jme3.scene.control.AbstractControl;
import com.jme3.scene.control.Control;

/**
 *
 * @author Ben
 */
public class ControlDestroy extends AbstractControl
{
    private long count;
    private long then;
    private long time;
    public ControlDestroy(long timef)
    {
        time = timef;
        then = System.currentTimeMillis();
    }
    
    @Override
    protected void controlUpdate(float tpf)
    {
        count = System.currentTimeMillis();
        if(count > then + time)
        {
            this.getSpatial().removeFromParent();
        }
    }

    @Override
    protected void controlRender(RenderManager rm, ViewPort vp)
    {
        
    }

    public Control cloneForSpatial(Spatial spatial)
    {
        return null;
    }
    
}
